/**
 * Copyright (c) 2017 ShopJsp. All Rights Reserved.
 * ============================================================================
 * 版权所有 2011 - 今 北京华宇盈通科技有限公司，并保留所有权利。
 * ----------------------------------------------------------------------------
 * 提示：在未取得SHOPJSP商业授权之前，您不能将本软件应用于商业用途，否则SHOPJSP将保留追究的权力。
 * ----------------------------------------------------------------------------
 * 官方网站：http://www.shopjsp.com
 * ============================================================================
 * @author 张丁方
 * @CreateTime 2017-4-26 15:13:32
 */
package com.hyyt.shopjsp.store.member.service.imp;

import com.hyyt.shopjsp.store.member.dao.ShopMemberShipDAO;
import com.hyyt.shopjsp.store.member.pojo.ShopMemberShip;
import com.hyyt.shopjsp.store.member.service.IShopMemberShipService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import org.apache.log4j.Logger;

@Service
public class ShopMemberShipService implements IShopMemberShipService {
    private static final Logger logger = Logger.getLogger(IShopMemberShipService.class);

    @Resource
    private ShopMemberShipDAO shopMemberShipDAO;

    /**
     * 保存SHOP_店铺会员申请
     *
     * @param shopMemberShip SHOP_店铺会员申请
     * @return 保存后的SHOP_店铺会员申请
     */
    @Override
    public void saveShopMemberShip(ShopMemberShip shopMemberShip) {
        shopMemberShipDAO.insert(shopMemberShip);
    }

    /**
     * 更新SHOP_店铺会员申请
     *
     * @param shopMemberShip SHOP_店铺会员申请
     * @return 更新后的SHOP_店铺会员申请
     */
    @Override
    public void updateShopMemberShip(ShopMemberShip shopMemberShip) {
        shopMemberShipDAO.update(shopMemberShip);
    }

    /**
     * 删除指定ID的SHOP_店铺会员申请
     *
     * @param id SHOP_店铺会员申请ID
     */
    @Override
    public void deleteShopMemberShip(Integer id) {
        shopMemberShipDAO.delete(id);
    }

    /**
     * 删除指定ID集合的SHOP_店铺会员申请
     *
     * @param ids SHOP_店铺会员申请ID集合
     */
    @Override
    public void deleteShopMemberShip(Collection<Integer> ids){
        shopMemberShipDAO.batchDelete(ids);
    }

    /**
     * 根据ID加载一个SHOP_店铺会员申请
     *
     * @param id SHOP_店铺会员申请ID
     * @return SHOP_店铺会员申请
     */
    @Override
    public ShopMemberShip loadShopMemberShip(Integer id) {
        return shopMemberShipDAO.load(id);
    }

    /**
     * 查询所有的SHOP_店铺会员申请，通常有最多取30000条记录的限制
     *
     * @return 所有的SHOP_店铺会员申请，通常有最多取30000条记录的限制
     */
    @Override
    public List<ShopMemberShip> queryAllShopMemberShip() {
        return shopMemberShipDAO.queryAll();
    }

    /**
     * 查询SHOP_店铺会员申请
     *
     * @param params 查询参数，为key-value形式
     * @return SHOP_店铺会员申请集合
     */
    @Override
    public List<ShopMemberShip> queryShopMemberShip(Map<String, Object> params) {
        return shopMemberShipDAO.query(params);
    }

    /**
     * 查询SHOP_店铺会员申请
     *
     * @param params   查询参数，没有则传null,分页参数key为“sortColumns”
     * @param startRow 起始行数（不含起始行的数据）
     * @param rowSize  要查询记录数
     * @return SHOP_店铺会员申请集合
     */
    @Override
    public List<ShopMemberShip> queryShopMemberShip(Map<String, Object> params, int startRow, int rowSize) {
        return shopMemberShipDAO.query(params, startRow, rowSize);
    }

    /**
     * 统计SHOP_店铺会员申请
     *
     * @param params 查询参数，没有则传null,分页参数key为“sortColumns”
     * @return 结果集记录数
     */
    @Override
    public int countShopMemberShip(Map<String, Object> params) {
        return shopMemberShipDAO.count(params);
    }
}